package com.maila.xiaoaoschool.activity;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

import com.maila.xiaoaoschool.R;
import com.maila.xiaoaoschool.util.StartActivityUtils;
import com.zhy.autolayout.AutoRelativeLayout;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * 个人设置
 * Created by Administrator on 2017/10/18.
 */

public class SettingActivity extends AppCompatActivity {
    @BindView(R.id.white_return_iv)
    AutoRelativeLayout whiteReturnIv;
    @BindView(R.id.btn_personal_info)
    TextView btnPersonalInfo;
    @BindView(R.id.tv_phone_num)
    TextView tvPhoneNum;
    @BindView(R.id.ll_change_phone)
    AutoRelativeLayout llChangePhone;
    @BindView(R.id.btn_personal_pwd)
    TextView btnPersonalPwd;
    @BindView(R.id.btn_pay_pwd)
    TextView btnPayPwd;
    @BindView(R.id.btn_clean_cache)
    TextView btnCleanCache;
    @BindView(R.id.btn_update)
    TextView btnUpdate;
    @BindView(R.id.btn_about_xiaoao)
    TextView btnAboutXiaoao;
    @BindView(R.id.btn_logout)
    Button btnLogout;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_setting);
        ButterKnife.bind(this);
    }

    @OnClick({R.id.white_return_iv, R.id.btn_personal_info, R.id.ll_change_phone, R.id.btn_personal_pwd, R.id.btn_pay_pwd, R.id.btn_clean_cache, R.id.btn_update, R.id.btn_about_xiaoao, R.id.btn_logout})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.white_return_iv:
                finish();
                break;
            case R.id.btn_personal_info:
                StartActivityUtils.start(this,PersonInfoActivity.class);
                break;
            case R.id.ll_change_phone:
                StartActivityUtils.start(this,ChangePhoneActivity.class);
                break;
            case R.id.btn_personal_pwd:
                StartActivityUtils.start(this,ForgetPwdActivity.class);
                break;
            case R.id.btn_pay_pwd:
                StartActivityUtils.start(this,BindAliActivity.class);
                break;
            case R.id.btn_clean_cache:
                Toast.makeText(this, "缓存已清除", Toast.LENGTH_SHORT).show();
                break;
            case R.id.btn_update:
                Toast.makeText(this, "已是最新版本", Toast.LENGTH_SHORT).show();
                break;
            case R.id.btn_about_xiaoao:
                StartActivityUtils.start(this,AboutXiaoActivity.class);
                break;
            case R.id.btn_logout:
                finish();
                break;
        }
    }
}
